<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="radio" name="a" value="a" id="a">a
    <input type="radio" name="a" value="b" id="b">b
    <script>

        // 在切换过程中，只会触发其中的一个事件而已，不会全部触发

        a.addEventListener('change', (e) => {
            console.log('a变化啦')
        })

        b.addEventListener('change', (e) => {
            console.log('b变化啦')
        })
    </script>
</body>
</html>